package com.cskaoyan.dbutils.handlerDemo;

import com.cskaoyan.connectionpool.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;

/**
 * 创建日期: 2022/04/23 11:59
 *
 * @author ciggar
 */
public class ScarlarHandlerDemo {

    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        Integer count = queryRunner.query("select count(*) from account = 1", new ScalarHandler<Integer>());

        System.out.println(count);
    }
}
